<?php

/***********************************************
 * IMPORTANT * 
 * for file handler component, do not use any
 * helpers ($html->file('userfile')) - this will
 * not work.  use standard html
 * <input type="file" name="userfile">
 */
?>
<h2>Liste des fichiers</h2>

<table>
    <tr><th>Nom du fichier</th><th>Chemin</th><th>Evenements associés</th><th>Action</th></tr>
  <?php foreach($uploads as $upload) { ?>
    <tr><td><?php echo $html->link($upload['Upload']['extra_field'], "/uploads/view/".$upload['Upload']['id']);?></td>
        <td><?php echo $upload['Upload']['file_name'];?></td>
        <td><?php foreach ($upload['Event'] as $e) { ?>
              <?php echo $e['title']; ?>  
            <?php } ?>
        </td>
        <td>
          <a href="<?php echo BASEDIR.'/upload'.DS.$upload['Upload']['subdir'].DS.$upload['Upload']['file_name'];?>">[voir]</a> 
          <?php echo $html->link('[éditer]', "/admin/uploads/edit/".$upload['Upload']['id']); ?> 
          <?php echo $html->link('[supprimer]', "/admin/uploads/delete/".$upload['Upload']['id']); ?>
        </td>
    </tr>
  <?php } ?>
</table>
